<?php

namespace app\api\validate;

use app\common\validate\BaseValidate;

class ShoppingCart extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'dishFlavor' => 'checkMixedString',
        'dishId' => 'integer',
        'setmealId' => 'integer',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'dishId.integer' => '菜品id要为数字',
        'setmealId.integer' => '套餐id要为数字',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['dishId','setmealId','dishFlavor'],
        'sub'  => ['dishId','setmealId','dishFlavor'],
    ];
}
